package wzc.design_pattern.construction.flyweight;

import java.util.Random;
import java.util.stream.IntStream;

/**
 * @Author 那和不是个啥
 * @Date 2025/7/20
 * @Description
 */

public class FlyweightPatternDemo {
    public static final String[] COLORS = {"红色", "蓝色", "绿色", "黄色", "粉色"};

    public static void main(String[] args) {
        Random random = new Random();

        IntStream.range(0,10).forEach(i -> {
            Circle circle = CircleFactory.getCircle(COLORS[random.nextInt(COLORS.length)]);
            int x = random.nextInt(100);
            int y = random.nextInt(100);
            int radius = random.nextInt(50) + 10;
            circle.draw(x, y, radius);
        });
    }
}
